<h3><B>专题列表</B></h3>
<br>
<a ng-click="addTopic()" class="btn-primary btn-sm nodecoration">添加专题</a>
<br>
<br>
<div class="form-group">
    <label class="control-label" for="textinput">小区:</label>
    <select ng-model="communityId" ng-options="m.objId as m.communityName for m in communityLabelList.data"
            ng-change="getTopicList(communityId)">
        <option value="">-- 请选择 --</option>
    </select>
    <a ng-click="generateAllTopicHtml()" style="float:right" class="btn-primary btn-sm nodecoration">生成所有专题HTML</a>
</div>

<div class="tab-content">
    <div class="tab-pane active" id="tab_a">
        <table class="table">
            <thead>
            <tr>
                <th>小区</th>
                <th>标题</th>
                <th>创建时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="topic in topicList">

                <td width="200">
                    <div ng-repeat="c in topic.community">
                        {{c.communityName}}
                    </div>
                </td>
                <td width="400">{{topic.title}}</td>
                <td width="200">{{topic.dateCreated | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                <td width="100">
                    <a type="button" class="btn btn-primary btn-xs" ng-click="editTopic(topic.objId)">编辑</a>
                    <a type="button" class="btn btn-secondary btn-xs"
                       ng-click="previewTopic(topic.url)">预览</a>
                    <a ng-show="topic.isValid == false" type="button" class="btn btn-secondary btn-xs"
                       ng-click="setTopicStatus(topic.objId,true)">发布</a>
                    <a ng-show="topic.isValid == true" type="button" class="btn btn-secondary btn-xs"
                       ng-click="setTopicStatus(topic.objId,false)">取消发布</a>
                    <button type="button" class="btn btn-danger btn-xs"
                            ng-click="deleteTopic(topic.objId)">删除
                    </button>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
</div>
<div class="modal fade" id="qrDiv">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">二维码：</h4>
            </div>
            <div id="qrBody" class="modal-body">
                <div id='qrcodeCanvas'></div>
            </div>
            <div class="modal-footer">
                <button type="button"
                        class="btn btn-default btn-sm" data-dismiss="modal">关闭
                </button>
            </div>
        </div>
    </div>
</div>